﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace PloobsEngine.SceneControl
{
    public class TillingPostEffect : IPostEffect
    {

        private float numTiles = 75;

        public float NumTiles
        {
            get { return numTiles; }
            set { numTiles = value; }
        }
        private float threshhold = 0.15f;

        public float Threshhold
        {
            get { return threshhold; }
            set { threshhold = value; }
        }

        Effect effect = null;        
        public void Draw(IRenderHelper rHelper, Microsoft.Xna.Framework.GameTime gt, Microsoft.Xna.Framework.Rectangle screenRec, IWorld world)
        {

            effect.Parameters["NumTiles"].SetValue(numTiles);
            effect.Parameters["Threshhold"].SetValue(threshhold);
            rHelper.RenderTextureToFullScreenSpriteBatch(PrincipalConstants.CurrentImage, effect,screenRec);
        }

        public void init(EngineStuff engine)
        {
            effect = EngineStuff.InternalContentManager.GetAsset<Effect>("Tilling");            
        }

    }
}
